//
//  NetCarSafeRange.m
//  carcareIOS
//
//  Created by ileo on 15/7/14.
//  Copyright (c) 2015年 baozun. All rights reserved.
//

#import "NetCarFence.h"
#import "AIUserInfo.h"

@implementation NetCarFence

+(NetCarFence *)carFenceDatas{
    return [__SELF request:@"/gpsfence/query" withParams:nil type:REQUEST_POST];
}

+(NetCarFence *)carFenceAddData:(NSDictionary *)data{
    return [__SELF request:@"/gpsfence/add" withParams:data type:REQUEST_POST];
}

+(NetCarFence *)carFenceModityData:(NSDictionary *)data{
    return [__SELF request:@"/gpsfence/modify" withParams:data type:REQUEST_POST];
}

+(NetCarFence *)carFenceDeleteDataWithID:(NSInteger)cid{
    return [__SELF request:@"/gpsfence/delete" withParams:@{@"id":@(cid)} type:REQUEST_POST];
}

-(NSDictionary *)requestCommonParams{
    if (![USERINFO.session isNotNil]) {
        return nil;
    }
    return @{@"tel":USERINFO.tel,@"userid":@(USERINFO.userID),@"session":USERINFO.session,@"vehicle_data":USERINFO.pastDevice};
}

@end
